package com.hxkj.service;

import com.hxkj.domain.po.Resources;
import com.hxkj.domain.po.ResourcesTree;
import com.integral.mall.file.storage.sftp.SFTPStorage;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 网站资源Service
 * <p>
 * Created by yaosy on 2018年6月6日
 */
public interface ResourcesService {

    /**
     * 新建文件资源
     * @param resources
     * @return
     * @throws Exception
     */
    ResultDataStruct<Resources> saveResources(Resources resources);


    /**
     * 新建目录资源
     * @param resources
     * @return
     * @throws Exception
     */
    ResultDataStruct<Resources> saveResourcesFolder(Resources resources,SFTPStorage sftpStorage);


    /**
     * 资源功能树
     * @param resources
     * @return
     * @throws Exception
     */
    ResultDataStruct<List<ResourcesTree>>  getResourcesTree(Resources resources) throws Exception;

    /**
     * 资源编辑
     * @param resources
     * @return
     * @throws Exception
     */
    ResultMessageStruct modify(Resources resources,SFTPStorage sftpStorage)throws Exception;


    /**
     * 获取单条资源数据
     * @param resources
     * @return
     * @throws Exception
     */
    ResultDataStruct<Resources> get(Resources resources) throws Exception;

    /**
     * 删除模板
     * @param resources
     * @return
     * @throws Exception
     */
    ResultMessageStruct remove(Resources resources)throws Exception;

    /**
     * 模板上传后需要保存的信息
     *
     * @param resource
     * @return
     * @throws Exception
     */
    ResultDataStruct<Resources> saveUploadContent(Resources resource);


    /**
     * 获取所有的资源
     *
     * @param resource
     * @return
     * @throws Exception
     */
    ResultDataStruct<List<Resources>> getResourcesBySiteId(Resources resource);

    /**
    * @author Mr.zheng
    * @Description modifyResourcesMd5 修改添加资源文件的MD5值
    * @Date 10:08 2018/8/20
    * @Param [resources]
    * @return com.platform.common.domain.result.ResultDataStruct
    **/
    ResultMessageStruct modifyResourcesMd5(Resources resources) throws Exception;

    /**
     * 匹配文件路径
     *
     * @param resources
     * @return
     * @throws Exception
     */
    List<Resources> selectContainPathFolder(Resources resources) throws Exception;
}
